﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml.Linq;
using MBSBLC;
using MBSVO;


namespace MBS_FoodBooking.Models
{
    public class FoodMenu
    {
        FoodItem foodItem = new FoodItem();
        private List<FoodItem> _MenuItemList;

        public List<FoodItem> MenuItemList
        {
            get { return _MenuItemList; }
            set { _MenuItemList = value; }
        }

        private ShoppingCartModel lstShoppingCart;

        public ShoppingCartModel LstShoppingCart
        {
            get { return lstShoppingCart; }
            set { lstShoppingCart = value; }
        }

        public FoodMenu()
        {
            MenuItemList = foodItem.getFoodItems();
            
            #region commented
            //XDocument xdoc = XDocument.Load("C:\\Users\\sus\\Documents\\visual studio 2010\\Projects\\MBS_FoodBooking\\MBS_FoodBooking\\Content\\Data\\FoodItemList.xml");
            //var menuList = from menuitem in xdoc.Descendants("FoodItem")
            //               select new
            //               {
            //                   FoodID = menuitem.Descendants("FoodId"),
            //                   Category = menuitem.Descendants("Category"),
            //                   ImgUrl = menuitem.Descendants("ImgUrl"),
            //                   ItemPrice = menuitem.Descendants("ItemPrice"),
            //                   Name = menuitem.Descendants("Name")
            //               };
            //foreach (var menuItem in menuList)
            //{
            //    FoodItem item = new FoodItem();
            //    item.FoodID = Convert.ToInt32(menuItem.FoodID);
            //    item.Category = menuItem.Category.ToString() ;
            //    item.ImgUrl = menuItem.ImgUrl.ToString();
            //    item.ItemPrice =Convert.ToDecimal(menuItem.ItemPrice);
            //    item.Name = menuItem.Name.ToString();
            //    MenuItemList.Add(item);
            //}
            #endregion
           
            
        }



    }
}